#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "EventLoop.h"
#include "WorkerThread.h"


//定义线程池
struct ThreadPool
{
    //主线程的反应堆模型
    struct EventLoop *mainLoop;
    bool isStart;
    int32_t threadNum;
    struct WorkerThread *workerThreads;
    int32_t index;
};

//初始化线程池
struct ThreadPool *threadPoolInit(struct EventLoop *mainLoop, int32_t count);
//启动线程池
void threadPollRun(struct ThreadPool *pool);
//取出线程池中的某个子线程的反应堆实例
struct EventLoop *takeWorkerEventLoop(struct ThreadPool *pool);